package com.bawei.product.controller;


import com.bawei.common.core.domain.Result;
import com.bawei.product.service.ItemService;
import com.bawei.product.vo.ItemInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

@RestController
@RequestMapping("/item")
public class ItemController {


    @Autowired
    private ItemService itemService;

    @RequestMapping("/{skuId}")
    public Result<ItemInfo> getItemBySkuId(@PathVariable("skuId") Long skuId) throws ExecutionException, InterruptedException {

        System.out.println("item service");
        return Result.success(itemService.getItemBySkuId(skuId));
    }

}
